<?php include( "templates/include/header.php" );
  include( "templates/include/adminHeader.php" );?>
 
      <div id="adminHeader">
        <h2>Administation des Actus</h2>
        <p>Vous &ecirc;tes connect&eacute; en tant que <b><?php echo htmlspecialchars( $_SESSION['username']) ?></b>. <a href="admin.php?action=logout"?>Se D&eacute;connecter</a></p>
      </div>
 
      <h1>Toutes les Actus</h1>
 
<?php if ( isset( $results['errorMessage'] ) ) { ?>
        <div class="errorMessage"><?php echo $results['errorMessage'] ?></div>
<?php } ?>
 
 
<?php if ( isset( $results['statusMessage'] ) ) { ?>
        <div class="statusMessage"><?php echo $results['statusMessage'] ?></div>
<?php } ?>
 
      <table>
        <tr>
          <th>Date</th>
          <th>Actualit&eacute;</th>
        </tr>
 
<?php foreach ( $results['news'] as $news ) { ?>
 
        <tr onclick="location='admin.php?action=editNews&amp;newsId=<?php echo $news->id?>'">
          <td><?php echo date('j M Y', $news->publicationDate)?></td>
          <td>
            <?php echo $news->title?>
          </td>
        </tr>
 
<?php } ?>
 
      </table>
 
      <p><?php echo $results['totalRows']?> actu<?php echo ( $results['totalRows'] != 1 ) ? 's' : '' ?> au total.</p>
 
      <p><a href="admin.php?action=newNews">Ajouter une Actu</a></p>
 
<?php 
  include( "templates/include/adminFooter.php" );
  include( "templates/include/footer.php" ); ?>